package dep

import "gitee.com/xuyiping_admin/pkg/di"

func DI(opts ...di.HubOption) *di.Hub {
	var hubOpts []di.HubOption
	if len(opts) != 0 {
		hubOpts = append(opts, Global())
	} else {
		hubOpts = append(hubOpts, Global())
	}

	hub, err := di.New(hubOpts...)
	if err != nil {
		panic(err)
	}

	return hub
}
